package main

import "fmt"

func isSubsequence(s string, t string) bool {
	tI, tN, tB := 0, len(t), []byte(t)
	for _, sV := range []byte(s) {
		for tI < tN {
			if tB[tI] != sV {
				tI++
			} else {
				break
			}
		}
		if tI == tN {
			return false
		}
		tI++
	}
	return true
}

func main() {
	fmt.Println(isSubsequence("abc", "ahbgdc"))
	fmt.Println(isSubsequence("axc", "ahbgdc"))
	fmt.Println(isSubsequence("aaaaaa", "bbaaaa"))
}
